let x = 13

var mySqrt = function (x) {
    let i = 1
    while (i) {
        let sum = i * i
        if (sum > x) {
            return (i - 1)
        }
        i++
    }
};

console.log(mySqrt(x));
